<div id="newReport" class="nr">
<form id="newReportForm" action="<?php echo $url ?>" method="post">
<input type="hidden" name="sf_method" value="put" />
<?php echo $form->renderHiddenFields() ?>

<table style="width: 100%">
	<tr valign="top">
		<td width="50%" style="padding-right: 5px;">
			<h2>New Report</h2>
			<?php echo $form->renderGlobalErrors() ?>
			<div class="label">
				<?php echo $form['name']->renderLabel() ?>
				<?php echo $form['name']->renderError() ?>
			</div>
			<?php echo $form['name']->render() ?>
			<table style="width: 100%">
				<tr>
					<td width="50%">
						<div class="label">
							<?php echo $form['sort_by']->renderLabel() ?>
							<?php echo $form['sort_by']->renderError() ?>
						</div>
						<?php echo $form['sort_by']->render() ?>
					</td>
					<td width="50%">
						<div class="label">
							<?php echo $form['sort_direction']->renderLabel() ?>
							<?php echo $form['sort_direction']->renderError() ?>
						</div>
						<?php echo $form['sort_direction']->render() ?>
					</td>
				</tr>
			</table>
			<div class="label">
				<?php echo $form['fields']->renderLabel() ?>
				<?php echo $form['fields']->renderError() ?>
			</div>
			<?php echo $form['fields']->render() ?>
		</td>
		<td width="50%" style="border-left: 1px black solid; padding-left: 5px;">
			<div class="label">Criteria:</div>
			<table style="width: 100%">
				<?php foreach($form->getCondFields() as $key => $val): ?>
					<tr>
						<td width="25%"><?php echo $key ?></td>
						<td width="25%"><?php echo $form["conds[$val][op]"]->render(); echo $form["conds[$val][op]"]->renderError() ?></td>
						<td width="50%"><?php echo $form["conds[$val][val]"]->render(); echo $form["conds[$val][val]"]->renderError() ?></td>
					</tr>
				<?php endforeach ?>
				<tr>
					<td colspan="3">
						<?php echo $form['global']->renderError() ?>
						<?php echo $form['global']->render() ?>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>

<div id="nrFooter">
<input type="submit" value="Create Report">
</div>

</form>
</div>